package com.gitee.wsl.mathematics.geometry.d2.rect.ext

import com.gitee.wsl.mathematics.geometry.d2.rect.RectangleShape2d
import com.gitee.wsl.mathematics.number.compareTo

fun<N:Number> RectangleShape2d<N, *,*>.overlap(r: RectangleShape2d<N, *,*>):Boolean =
    left < r.right && right > r.left && top < r.bottom && bottom > r.top

//fun isContainedIn(a: Rectangle, b: Rectangle): Boolean = a.x >= b.x && a.y >= b.y && a.x + a.width <= b.x + b.width && a.y + a.height <= b.y + b.height
